A network file server provides network clients, such as personal computers or workstations, with shared access to a file system in data storage. The network file server supports a network data transmission protocol, such as the Transmission Control Protocol (TCP) over the Internet Protocol (IP), for transmission of data packets between the network file server and the network clients. The network file server supports a file access protocol, such as the Network File System (NFS) protocol or the Common Internet File System (CIFS) protocol, for client access to a hierarchical file system of directories and regular data files in the data storage. The network file server maintains a file system cache memory of recently accessed files, and if data to be accessed is not found in the file system cache, then the network file server fetches the data the data storage. The network file server uses a storage access protocol, such as the Small Computer System Interface (SCSI) or Fibre-Channel (FC) protocol, for accessing data in the data storage.
A network file server typically includes a general purpose commodity digital computer and a disk storage array. The commodity general purpose digital computer is often loaded up with random access memory for the file system cache, and has a good number of network adapters and disk adapters for enhanced throughput between the client network and the disk storage array. The commodity general purpose digital computer is especially programmed to exploit the conventional multi-tasking and multi-processing capabilities of the commodity general purpose digital computer. These conventional multi-tasking and multi-processing capabilities include the pipelining of input/output data though network interface adapters, disk adapters, and a direct memory access input/output unit, and the use of multiple “core” central processing units (CPUs) for processing of the data in a shared random access memory.
Before the commercial availability of multi-CPU commodity general purpose digital computers, network file servers employed a multi-tasking real-time operating system for exploiting the multi-tasking capabilities of the commodity general-purpose computers. For example, as described in Vahalia et al. U.S. Pat. No. 5,933,603, incorporated herein by reference, a real-time scheduler was used in a video file server for scheduling isochronous tasks and also general purpose tasks programmed as code threads. The real-time tasks not only ensured isochronous delivery of the real-time video but also were used for “polling” device drivers and communication stacks. As further described in Vahalia U.S. Pat. No. 5,893,140, incorporated herein by reference, this real-time scheduler was also used in a network file server. The method of polling for pending work, as opposed to interrupt-driven processing, was said to contribute to system stability and alleviate most of the problems that arise during overloads. It also was said to provide isolation between multiple real-time tasks that have differing performance requirements.
The use of a multi-CPU general purpose commodity digital computer in a network file server introduced a problem of distributing the execution of real-time and general-purpose code threads among the multiple “core” CPUs. It was discovered that some code threads should be permanently assigned to a specific CPU, and other code threads should be assigned initially or temporarily to a specific CPU when execution of the code thread begins. In other words, each code thread should have either a “hard” or a “soft” affinity for a CPU. For example, as described in Bono U.S. Pat. No. 7,178,145, incorporated herein by reference, each processor has a respective hard affinity queue and soft affinity queue. For execution of a thread, a queue loader places an instance of the thread upon the hard or soft affinity queue of a selected processor. The selection may use an affinity attribute, processor attribute, accessor function, or a respective program of code threads for each processor. A thread instance on a processor's hard affinity queue is executed only by that processor. A thread instance on a processor's soft affinity queue is executed by that processor unless another processor has a soft affinity queue empty of thread instances ready for execution. Each processor alternates service priority between its hard and soft affinity queues.